<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE BangPatterns #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE MagicHash #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-}</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">--  (c) The University of Glasgow 2002-2006</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="hs-comment">-- | Bytecode assembler and linker</span><span>
</span><span id="line-12"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.ByteCode.Linker</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-13"></span><span>        </span><span class="annot"><a href="GHC.ByteCode.Linker.html#ClosureEnv"><span class="hs-identifier">ClosureEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.ByteCode.Linker.html#emptyClosureEnv"><span class="hs-identifier">emptyClosureEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.ByteCode.Linker.html#extendClosureEnv"><span class="hs-identifier">extendClosureEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>        </span><span class="annot"><a href="GHC.ByteCode.Linker.html#linkBCO"><span class="hs-identifier">linkBCO</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.ByteCode.Linker.html#lookupStaticPtr"><span class="hs-identifier">lookupStaticPtr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.ByteCode.Linker.html#lookupIE"><span class="hs-identifier">lookupIE</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.ByteCode.Linker.html#nameToCLabel"><span class="hs-identifier">nameToCLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.ByteCode.Linker.html#linkFail"><span class="hs-identifier">linkFail</span></a></span><span>
</span><span id="line-17"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#"><span class="hs-identifier">GHCi.RemoteTypes</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.ResolvedBCO.html#"><span class="hs-identifier">GHCi.ResolvedBCO</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.BreakArray.html#"><span class="hs-identifier">GHCi.BreakArray</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghci/src/SizedSeq.html#"><span class="hs-identifier">SizedSeq</span></a></span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Interpreter.html"><span class="hs-identifier">GHC.Runtime.Interpreter</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html"><span class="hs-identifier">GHC.ByteCode.Types</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.PrimOps.html"><span class="hs-identifier">GHC.Builtin.PrimOps</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.html"><span class="hs-identifier">GHC.Unit</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html"><span class="hs-identifier">GHC.Utils.Panic</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-comment">-- Standard libraries</span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../array/src/Data.Array.Unboxed.html#"><span class="hs-identifier">Data.Array.Unboxed</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.Ptr.html#"><span class="hs-identifier">Foreign.Ptr</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exts.html#"><span class="hs-identifier">GHC.Exts</span></a></span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span class="hs-comment">{-
  Linking interpretables into something we can run
-}</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-keyword">type</span><span> </span><span id="ClosureEnv"><span class="annot"><a href="GHC.ByteCode.Linker.html#ClosureEnv"><span class="hs-identifier hs-var">ClosureEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#emptyClosureEnv"><span class="hs-identifier hs-type">emptyClosureEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.ByteCode.Linker.html#ClosureEnv"><span class="hs-identifier hs-type">ClosureEnv</span></a></span><span>
</span><span id="line-52"></span><span id="emptyClosureEnv"><span class="annot"><span class="annottext">emptyClosureEnv :: ClosureEnv
</span><a href="GHC.ByteCode.Linker.html#emptyClosureEnv"><span class="hs-identifier hs-var hs-var">emptyClosureEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ClosureEnv
forall a. NameEnv a
</span><a href="GHC.Types.Name.Env.html#emptyNameEnv"><span class="hs-identifier hs-var">emptyNameEnv</span></a></span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#extendClosureEnv"><span class="hs-identifier hs-type">extendClosureEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.ByteCode.Linker.html#ClosureEnv"><span class="hs-identifier hs-type">ClosureEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Linker.html#ClosureEnv"><span class="hs-identifier hs-type">ClosureEnv</span></a></span><span>
</span><span id="line-55"></span><span id="extendClosureEnv"><span class="annot"><span class="annottext">extendClosureEnv :: ClosureEnv -&gt; [(Name, ForeignHValue)] -&gt; ClosureEnv
</span><a href="GHC.ByteCode.Linker.html#extendClosureEnv"><span class="hs-identifier hs-var hs-var">extendClosureEnv</span></a></span></span><span> </span><span id="local-6989586621680995450"><span class="annot"><span class="annottext">ClosureEnv
</span><a href="#local-6989586621680995450"><span class="hs-identifier hs-var">cl_env</span></a></span></span><span> </span><span id="local-6989586621680995449"><span class="annot"><span class="annottext">[(Name, ForeignHValue)]
</span><a href="#local-6989586621680995449"><span class="hs-identifier hs-var">pairs</span></a></span></span><span>
</span><span id="line-56"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ClosureEnv -&gt; [(Name, (Name, ForeignHValue))] -&gt; ClosureEnv
forall a. NameEnv a -&gt; [(Name, a)] -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#extendNameEnvList"><span class="hs-identifier hs-var">extendNameEnvList</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureEnv
</span><a href="#local-6989586621680995450"><span class="hs-identifier hs-var">cl_env</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995447"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995447"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621680995446"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680995447"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995447"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621680995446"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621680995446"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Name, ForeignHValue)]
</span><a href="#local-6989586621680995449"><span class="hs-identifier hs-var">pairs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span class="hs-comment">{-
  Linking interpretables into something we can run
-}</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#linkBCO"><span class="hs-identifier hs-type">linkBCO</span></a></span><span>
</span><span id="line-63"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#ItblEnv"><span class="hs-identifier hs-type">ItblEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Linker.html#ClosureEnv"><span class="hs-identifier hs-type">ClosureEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#RemoteRef"><span class="hs-identifier hs-type">RemoteRef</span></a></span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.BreakArray.html#BreakArray"><span class="hs-identifier hs-type">BreakArray</span></a></span><span>
</span><span id="line-64"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#UnlinkedBCO"><span class="hs-identifier hs-type">UnlinkedBCO</span></a></span><span>
</span><span id="line-65"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.ResolvedBCO.html#ResolvedBCO"><span class="hs-identifier hs-type">ResolvedBCO</span></a></span><span>
</span><span id="line-66"></span><span id="linkBCO"><span class="annot"><span class="annottext">linkBCO :: HscEnv
-&gt; ItblEnv
-&gt; ClosureEnv
-&gt; NameEnv Int
-&gt; RemoteRef BreakArray
-&gt; UnlinkedBCO
-&gt; IO ResolvedBCO
</span><a href="GHC.ByteCode.Linker.html#linkBCO"><span class="hs-identifier hs-var hs-var">linkBCO</span></a></span></span><span> </span><span id="local-6989586621680995445"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995445"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680995444"><span class="annot"><span class="annottext">ItblEnv
</span><a href="#local-6989586621680995444"><span class="hs-identifier hs-var">ie</span></a></span></span><span> </span><span id="local-6989586621680995443"><span class="annot"><span class="annottext">ClosureEnv
</span><a href="#local-6989586621680995443"><span class="hs-identifier hs-var">ce</span></a></span></span><span> </span><span id="local-6989586621680995442"><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680995442"><span class="hs-identifier hs-var">bco_ix</span></a></span></span><span> </span><span id="local-6989586621680995441"><span class="annot"><span class="annottext">RemoteRef BreakArray
</span><a href="#local-6989586621680995441"><span class="hs-identifier hs-var">breakarray</span></a></span></span><span>
</span><span id="line-67"></span><span>           </span><span class="hs-special">(</span><span class="annot"><a href="GHC.ByteCode.Types.html#UnlinkedBCO"><span class="hs-identifier hs-type">UnlinkedBCO</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680995439"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680995439"><span class="hs-identifier hs-var">arity</span></a></span></span><span> </span><span id="local-6989586621680995438"><span class="annot"><span class="annottext">UArray Int Word16
</span><a href="#local-6989586621680995438"><span class="hs-identifier hs-var">insns</span></a></span></span><span> </span><span id="local-6989586621680995437"><span class="annot"><span class="annottext">UArray Int Word64
</span><a href="#local-6989586621680995437"><span class="hs-identifier hs-var">bitmap</span></a></span></span><span> </span><span id="local-6989586621680995436"><span class="annot"><span class="annottext">SizedSeq BCONPtr
</span><a href="#local-6989586621680995436"><span class="hs-identifier hs-var">lits0</span></a></span></span><span> </span><span id="local-6989586621680995435"><span class="annot"><span class="annottext">SizedSeq BCOPtr
</span><a href="#local-6989586621680995435"><span class="hs-identifier hs-var">ptrs0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-68"></span><span>  </span><span class="hs-comment">-- fromIntegral Word -&gt; Word64 should be a no op if Word is Word64</span><span>
</span><span id="line-69"></span><span>  </span><span class="hs-comment">-- otherwise it will result in a cast to longlong on 32bit systems.</span><span>
</span><span id="line-70"></span><span>  </span><span id="local-6989586621680995434"><span class="annot"><span class="annottext">[Word64]
</span><a href="#local-6989586621680995434"><span class="hs-identifier hs-var">lits</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(BCONPtr -&gt; IO Word64) -&gt; [BCONPtr] -&gt; IO [Word64]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Word -&gt; Word64) -&gt; IO Word -&gt; IO Word64
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Word -&gt; Word64
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Word -&gt; IO Word64)
-&gt; (BCONPtr -&gt; IO Word) -&gt; BCONPtr -&gt; IO Word64
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ItblEnv -&gt; BCONPtr -&gt; IO Word
</span><a href="GHC.ByteCode.Linker.html#lookupLiteral"><span class="hs-identifier hs-var">lookupLiteral</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995445"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ItblEnv
</span><a href="#local-6989586621680995444"><span class="hs-identifier hs-var">ie</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SizedSeq BCONPtr -&gt; [BCONPtr]
forall a. SizedSeq a -&gt; [a]
</span><a href="../../ghci/src/SizedSeq.html#ssElts"><span class="hs-identifier hs-var">ssElts</span></a></span><span> </span><span class="annot"><span class="annottext">SizedSeq BCONPtr
</span><a href="#local-6989586621680995436"><span class="hs-identifier hs-var">lits0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-71"></span><span>  </span><span id="local-6989586621680995429"><span class="annot"><span class="annottext">[ResolvedBCOPtr]
</span><a href="#local-6989586621680995429"><span class="hs-identifier hs-var">ptrs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(BCOPtr -&gt; IO ResolvedBCOPtr) -&gt; [BCOPtr] -&gt; IO [ResolvedBCOPtr]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv
-&gt; ItblEnv
-&gt; ClosureEnv
-&gt; NameEnv Int
-&gt; RemoteRef BreakArray
-&gt; BCOPtr
-&gt; IO ResolvedBCOPtr
</span><a href="GHC.ByteCode.Linker.html#resolvePtr"><span class="hs-identifier hs-var">resolvePtr</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995445"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ItblEnv
</span><a href="#local-6989586621680995444"><span class="hs-identifier hs-var">ie</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureEnv
</span><a href="#local-6989586621680995443"><span class="hs-identifier hs-var">ce</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680995442"><span class="hs-identifier hs-var">bco_ix</span></a></span><span> </span><span class="annot"><span class="annottext">RemoteRef BreakArray
</span><a href="#local-6989586621680995441"><span class="hs-identifier hs-var">breakarray</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SizedSeq BCOPtr -&gt; [BCOPtr]
forall a. SizedSeq a -&gt; [a]
</span><a href="../../ghci/src/SizedSeq.html#ssElts"><span class="hs-identifier hs-var">ssElts</span></a></span><span> </span><span class="annot"><span class="annottext">SizedSeq BCOPtr
</span><a href="#local-6989586621680995435"><span class="hs-identifier hs-var">ptrs0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span>  </span><span class="annot"><span class="annottext">ResolvedBCO -&gt; IO ResolvedBCO
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
-&gt; Int
-&gt; UArray Int Word16
-&gt; UArray Int Word64
-&gt; UArray Int Word64
-&gt; SizedSeq ResolvedBCOPtr
-&gt; ResolvedBCO
</span><a href="../../ghci/src/GHCi.ResolvedBCO.html#ResolvedBCO"><span class="hs-identifier hs-var">ResolvedBCO</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghci/src/GHCi.ResolvedBCO.html#isLittleEndian"><span class="hs-identifier hs-var">isLittleEndian</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680995439"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">UArray Int Word16
</span><a href="#local-6989586621680995438"><span class="hs-identifier hs-var">insns</span></a></span><span> </span><span class="annot"><span class="annottext">UArray Int Word64
</span><a href="#local-6989586621680995437"><span class="hs-identifier hs-var">bitmap</span></a></span><span>
</span><span id="line-73"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Int, Int) -&gt; [Word64] -&gt; UArray Int Word64
forall (a :: * -&gt; * -&gt; *) e i.
(IArray a e, Ix i) =&gt;
(i, i) -&gt; [e] -&gt; a i e
</span><a href="../../array/src/Data.Array.Base.html#listArray"><span class="hs-identifier hs-var">listArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Word -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SizedSeq BCONPtr -&gt; Word
forall a. SizedSeq a -&gt; Word
</span><a href="../../ghci/src/SizedSeq.html#sizeSS"><span class="hs-identifier hs-var">sizeSS</span></a></span><span> </span><span class="annot"><span class="annottext">SizedSeq BCONPtr
</span><a href="#local-6989586621680995436"><span class="hs-identifier hs-var">lits0</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Word64]
</span><a href="#local-6989586621680995434"><span class="hs-identifier hs-var">lits</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-74"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SizedSeq ResolvedBCOPtr
-&gt; [ResolvedBCOPtr] -&gt; SizedSeq ResolvedBCOPtr
forall a. SizedSeq a -&gt; [a] -&gt; SizedSeq a
</span><a href="../../ghci/src/SizedSeq.html#addListToSS"><span class="hs-identifier hs-var">addListToSS</span></a></span><span> </span><span class="annot"><span class="annottext">SizedSeq ResolvedBCOPtr
forall a. SizedSeq a
</span><a href="../../ghci/src/SizedSeq.html#emptySS"><span class="hs-identifier hs-var">emptySS</span></a></span><span> </span><span class="annot"><span class="annottext">[ResolvedBCOPtr]
</span><a href="#local-6989586621680995429"><span class="hs-identifier hs-var">ptrs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#lookupLiteral"><span class="hs-identifier hs-type">lookupLiteral</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#ItblEnv"><span class="hs-identifier hs-type">ItblEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#BCONPtr"><span class="hs-identifier hs-type">BCONPtr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span>
</span><span id="line-77"></span><span id="lookupLiteral"><span class="annot"><span class="annottext">lookupLiteral :: HscEnv -&gt; ItblEnv -&gt; BCONPtr -&gt; IO Word
</span><a href="GHC.ByteCode.Linker.html#lookupLiteral"><span class="hs-identifier hs-var hs-var">lookupLiteral</span></a></span></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ItblEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.ByteCode.Types.html#BCONPtrWord"><span class="hs-identifier hs-type">BCONPtrWord</span></a></span><span> </span><span id="local-6989586621680995420"><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621680995420"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word -&gt; IO Word
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Word
</span><a href="#local-6989586621680995420"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-78"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#lookupLiteral"><span class="hs-identifier hs-var">lookupLiteral</span></a></span><span> </span><span id="local-6989586621680995419"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995419"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="annot"><span class="annottext">ItblEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.ByteCode.Types.html#BCONPtrLbl"><span class="hs-identifier hs-type">BCONPtrLbl</span></a></span><span>  </span><span id="local-6989586621680995417"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680995417"><span class="hs-identifier hs-var">sym</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-79"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span id="local-6989586621680995415"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680995415"><span class="hs-identifier hs-var">a#</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; FastString -&gt; IO (Ptr ())
</span><a href="GHC.ByteCode.Linker.html#lookupStaticPtr"><span class="hs-identifier hs-var">lookupStaticPtr</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995419"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680995417"><span class="hs-identifier hs-var">sym</span></a></span><span>
</span><span id="line-80"></span><span>  </span><span class="annot"><span class="annottext">Word -&gt; IO Word
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word# -&gt; Word
</span><span class="hs-identifier hs-var">W#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><span class="hs-identifier hs-var">int2Word#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; Int#
</span><span class="hs-identifier hs-var">addr2Int#</span></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680995415"><span class="hs-identifier hs-var">a#</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-81"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#lookupLiteral"><span class="hs-identifier hs-var">lookupLiteral</span></a></span><span> </span><span id="local-6989586621680995414"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995414"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680995413"><span class="annot"><span class="annottext">ItblEnv
</span><a href="#local-6989586621680995413"><span class="hs-identifier hs-var">ie</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.ByteCode.Types.html#BCONPtrItbl"><span class="hs-identifier hs-type">BCONPtrItbl</span></a></span><span> </span><span id="local-6989586621680995411"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995411"><span class="hs-identifier hs-var">nm</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-82"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span id="local-6989586621680995410"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680995410"><span class="hs-identifier hs-var">a#</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ItblEnv -&gt; Name -&gt; IO (Ptr ())
</span><a href="GHC.ByteCode.Linker.html#lookupIE"><span class="hs-identifier hs-var">lookupIE</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995414"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ItblEnv
</span><a href="#local-6989586621680995413"><span class="hs-identifier hs-var">ie</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995411"><span class="hs-identifier hs-var">nm</span></a></span><span>
</span><span id="line-83"></span><span>  </span><span class="annot"><span class="annottext">Word -&gt; IO Word
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word# -&gt; Word
</span><span class="hs-identifier hs-var">W#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><span class="hs-identifier hs-var">int2Word#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; Int#
</span><span class="hs-identifier hs-var">addr2Int#</span></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680995410"><span class="hs-identifier hs-var">a#</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-84"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#lookupLiteral"><span class="hs-identifier hs-var">lookupLiteral</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ItblEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.ByteCode.Types.html#BCONPtrStr"><span class="hs-identifier hs-type">BCONPtrStr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-85"></span><span>  </span><span class="hs-comment">-- should be eliminated during assembleBCOs</span><span>
</span><span id="line-86"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; IO Word
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lookupLiteral: BCONPtrStr&quot;</span></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#lookupStaticPtr"><span class="hs-identifier hs-type">lookupStaticPtr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-89"></span><span id="lookupStaticPtr"><span class="annot"><span class="annottext">lookupStaticPtr :: HscEnv -&gt; FastString -&gt; IO (Ptr ())
</span><a href="GHC.ByteCode.Linker.html#lookupStaticPtr"><span class="hs-identifier hs-var hs-var">lookupStaticPtr</span></a></span></span><span> </span><span id="local-6989586621680995407"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995407"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680995406"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680995406"><span class="hs-identifier hs-var">addr_of_label_string</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-90"></span><span>  </span><span id="local-6989586621680995405"><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="#local-6989586621680995405"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; FastString -&gt; IO (Maybe (Ptr ()))
</span><a href="GHC.Runtime.Interpreter.html#lookupSymbol"><span class="hs-identifier hs-var">lookupSymbol</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995407"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680995406"><span class="hs-identifier hs-var">addr_of_label_string</span></a></span><span>
</span><span id="line-91"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="#local-6989586621680995405"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-92"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680995403"><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621680995403"><span class="hs-identifier hs-var">ptr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr () -&gt; IO (Ptr ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621680995403"><span class="hs-identifier hs-var">ptr</span></a></span><span>
</span><span id="line-93"></span><span>    </span><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO (Ptr ())
forall a. String -&gt; String -&gt; IO a
</span><a href="GHC.ByteCode.Linker.html#linkFail"><span class="hs-identifier hs-var">linkFail</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GHC.ByteCode.Linker: can't find label&quot;</span></span><span>
</span><span id="line-94"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680995406"><span class="hs-identifier hs-var">addr_of_label_string</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#lookupIE"><span class="hs-identifier hs-type">lookupIE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#ItblEnv"><span class="hs-identifier hs-type">ItblEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-97"></span><span id="lookupIE"><span class="annot"><span class="annottext">lookupIE :: HscEnv -&gt; ItblEnv -&gt; Name -&gt; IO (Ptr ())
</span><a href="GHC.ByteCode.Linker.html#lookupIE"><span class="hs-identifier hs-var hs-var">lookupIE</span></a></span></span><span> </span><span id="local-6989586621680995401"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995401"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680995400"><span class="annot"><span class="annottext">ItblEnv
</span><a href="#local-6989586621680995400"><span class="hs-identifier hs-var">ie</span></a></span></span><span> </span><span id="local-6989586621680995399"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995399"><span class="hs-identifier hs-var">con_nm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-98"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ItblEnv -&gt; Name -&gt; Maybe (Name, ItblPtr)
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">ItblEnv
</span><a href="#local-6989586621680995400"><span class="hs-identifier hs-var">ie</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995399"><span class="hs-identifier hs-var">con_nm</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-99"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#ItblPtr"><span class="hs-identifier hs-type">ItblPtr</span></a></span><span> </span><span id="local-6989586621680995396"><span class="annot"><span class="annottext">RemotePtr StgInfoTable
</span><a href="#local-6989586621680995396"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr () -&gt; IO (Ptr ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RemotePtr () -&gt; Ptr ()
forall a. RemotePtr a -&gt; Ptr a
</span><a href="../../ghci/src/GHCi.RemoteTypes.html#fromRemotePtr"><span class="hs-identifier hs-var">fromRemotePtr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RemotePtr StgInfoTable -&gt; RemotePtr ()
forall a b. RemotePtr a -&gt; RemotePtr b
</span><a href="../../ghci/src/GHCi.RemoteTypes.html#castRemotePtr"><span class="hs-identifier hs-var">castRemotePtr</span></a></span><span> </span><span class="annot"><span class="annottext">RemotePtr StgInfoTable
</span><a href="#local-6989586621680995396"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>    </span><span class="annot"><span class="annottext">Maybe (Name, ItblPtr)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-comment">-- try looking up in the object files.</span><span>
</span><span id="line-101"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680995393"><span class="annot"><span class="annottext">sym_to_find1 :: FastString
</span><a href="#local-6989586621680995393"><span class="hs-identifier hs-var hs-var">sym_to_find1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; String -&gt; FastString
</span><a href="GHC.ByteCode.Linker.html#nameToCLabel"><span class="hs-identifier hs-var">nameToCLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995399"><span class="hs-identifier hs-var">con_nm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;con_info&quot;</span></span><span>
</span><span id="line-102"></span><span>       </span><span id="local-6989586621680995392"><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="#local-6989586621680995392"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; FastString -&gt; IO (Maybe (Ptr ()))
</span><a href="GHC.Runtime.Interpreter.html#lookupSymbol"><span class="hs-identifier hs-var">lookupSymbol</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995401"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680995393"><span class="hs-identifier hs-var">sym_to_find1</span></a></span><span>
</span><span id="line-103"></span><span>       </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="#local-6989586621680995392"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-104"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680995391"><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621680995391"><span class="hs-identifier hs-var">addr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr () -&gt; IO (Ptr ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621680995391"><span class="hs-identifier hs-var">addr</span></a></span><span>
</span><span id="line-105"></span><span>          </span><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-106"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-comment">-- perhaps a nullary constructor?</span><span>
</span><span id="line-107"></span><span>                   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680995390"><span class="annot"><span class="annottext">sym_to_find2 :: FastString
</span><a href="#local-6989586621680995390"><span class="hs-identifier hs-var hs-var">sym_to_find2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; String -&gt; FastString
</span><a href="GHC.ByteCode.Linker.html#nameToCLabel"><span class="hs-identifier hs-var">nameToCLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995399"><span class="hs-identifier hs-var">con_nm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;static_info&quot;</span></span><span>
</span><span id="line-108"></span><span>                   </span><span id="local-6989586621680995389"><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="#local-6989586621680995389"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; FastString -&gt; IO (Maybe (Ptr ()))
</span><a href="GHC.Runtime.Interpreter.html#lookupSymbol"><span class="hs-identifier hs-var">lookupSymbol</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995401"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680995390"><span class="hs-identifier hs-var">sym_to_find2</span></a></span><span>
</span><span id="line-109"></span><span>                   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="#local-6989586621680995389"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-110"></span><span>                      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680995388"><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621680995388"><span class="hs-identifier hs-var">addr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ptr () -&gt; IO (Ptr ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621680995388"><span class="hs-identifier hs-var">addr</span></a></span><span>
</span><span id="line-111"></span><span>                      </span><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO (Ptr ())
forall a. String -&gt; String -&gt; IO a
</span><a href="GHC.ByteCode.Linker.html#linkFail"><span class="hs-identifier hs-var">linkFail</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GHC.ByteCode.Linker.lookupIE&quot;</span></span><span>
</span><span id="line-112"></span><span>                                      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680995393"><span class="hs-identifier hs-var">sym_to_find1</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; or &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-113"></span><span>                                       </span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680995390"><span class="hs-identifier hs-var">sym_to_find2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#lookupPrimOp"><span class="hs-identifier hs-type">lookupPrimOp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Builtin.PrimOps.html#PrimOp"><span class="hs-identifier hs-type">PrimOp</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#RemotePtr"><span class="hs-identifier hs-type">RemotePtr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-116"></span><span id="lookupPrimOp"><span class="annot"><span class="annottext">lookupPrimOp :: HscEnv -&gt; PrimOp -&gt; IO (RemotePtr ())
</span><a href="GHC.ByteCode.Linker.html#lookupPrimOp"><span class="hs-identifier hs-var hs-var">lookupPrimOp</span></a></span></span><span> </span><span id="local-6989586621680995386"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995386"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680995385"><span class="annot"><span class="annottext">PrimOp
</span><a href="#local-6989586621680995385"><span class="hs-identifier hs-var">primop</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-117"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680995384"><span class="annot"><span class="annottext">sym_to_find :: String
</span><a href="#local-6989586621680995384"><span class="hs-identifier hs-var hs-var">sym_to_find</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrimOp -&gt; String -&gt; String
</span><a href="GHC.ByteCode.Linker.html#primopToCLabel"><span class="hs-identifier hs-var">primopToCLabel</span></a></span><span> </span><span class="annot"><span class="annottext">PrimOp
</span><a href="#local-6989586621680995385"><span class="hs-identifier hs-var">primop</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;closure&quot;</span></span><span>
</span><span id="line-118"></span><span>  </span><span id="local-6989586621680995382"><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="#local-6989586621680995382"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; FastString -&gt; IO (Maybe (Ptr ()))
</span><a href="GHC.Runtime.Interpreter.html#lookupSymbol"><span class="hs-identifier hs-var">lookupSymbol</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995386"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995384"><span class="hs-identifier hs-var">sym_to_find</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-119"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="#local-6989586621680995382"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-120"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680995380"><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621680995380"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RemotePtr () -&gt; IO (RemotePtr ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr () -&gt; RemotePtr ()
forall a. Ptr a -&gt; RemotePtr a
</span><a href="../../ghci/src/GHCi.RemoteTypes.html#toRemotePtr"><span class="hs-identifier hs-var">toRemotePtr</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621680995380"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-121"></span><span>    </span><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO (RemotePtr ())
forall a. String -&gt; String -&gt; IO a
</span><a href="GHC.ByteCode.Linker.html#linkFail"><span class="hs-identifier hs-var">linkFail</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GHC.ByteCode.Linker.lookupCE(primop)&quot;</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995384"><span class="hs-identifier hs-var">sym_to_find</span></a></span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#resolvePtr"><span class="hs-identifier hs-type">resolvePtr</span></a></span><span>
</span><span id="line-124"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#ItblEnv"><span class="hs-identifier hs-type">ItblEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Linker.html#ClosureEnv"><span class="hs-identifier hs-type">ClosureEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#RemoteRef"><span class="hs-identifier hs-type">RemoteRef</span></a></span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.BreakArray.html#BreakArray"><span class="hs-identifier hs-type">BreakArray</span></a></span><span>
</span><span id="line-125"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ByteCode.Types.html#BCOPtr"><span class="hs-identifier hs-type">BCOPtr</span></a></span><span>
</span><span id="line-126"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.ResolvedBCO.html#ResolvedBCOPtr"><span class="hs-identifier hs-type">ResolvedBCOPtr</span></a></span><span>
</span><span id="line-127"></span><span id="resolvePtr"><span class="annot"><span class="annottext">resolvePtr :: HscEnv
-&gt; ItblEnv
-&gt; ClosureEnv
-&gt; NameEnv Int
-&gt; RemoteRef BreakArray
-&gt; BCOPtr
-&gt; IO ResolvedBCOPtr
</span><a href="GHC.ByteCode.Linker.html#resolvePtr"><span class="hs-identifier hs-var hs-var">resolvePtr</span></a></span></span><span> </span><span id="local-6989586621680995378"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995378"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680995377"><span class="annot"><span class="annottext">ItblEnv
</span><a href="#local-6989586621680995377"><span class="hs-identifier hs-var">_ie</span></a></span></span><span> </span><span id="local-6989586621680995376"><span class="annot"><span class="annottext">ClosureEnv
</span><a href="#local-6989586621680995376"><span class="hs-identifier hs-var">ce</span></a></span></span><span> </span><span id="local-6989586621680995375"><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680995375"><span class="hs-identifier hs-var">bco_ix</span></a></span></span><span> </span><span class="annot"><span class="annottext">RemoteRef BreakArray
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.ByteCode.Types.html#BCOPtrName"><span class="hs-identifier hs-type">BCOPtrName</span></a></span><span> </span><span id="local-6989586621680995373"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995373"><span class="hs-identifier hs-var">nm</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-128"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680995372"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680995372"><span class="hs-identifier hs-var">ix</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NameEnv Int -&gt; Name -&gt; Maybe Int
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680995375"><span class="hs-identifier hs-var">bco_ix</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995373"><span class="hs-identifier hs-var">nm</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-129"></span><span>    </span><span class="annot"><span class="annottext">ResolvedBCOPtr -&gt; IO ResolvedBCOPtr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ResolvedBCOPtr
</span><a href="../../ghci/src/GHCi.ResolvedBCO.html#ResolvedBCORef"><span class="hs-identifier hs-var">ResolvedBCORef</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680995372"><span class="hs-identifier hs-var">ix</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ref to another BCO in this group</span><span>
</span><span id="line-130"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680995370"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621680995370"><span class="hs-identifier hs-var">rhv</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ClosureEnv -&gt; Name -&gt; Maybe (Name, ForeignHValue)
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureEnv
</span><a href="#local-6989586621680995376"><span class="hs-identifier hs-var">ce</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995373"><span class="hs-identifier hs-var">nm</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-131"></span><span>    </span><span class="annot"><span class="annottext">ResolvedBCOPtr -&gt; IO ResolvedBCOPtr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RemoteRef HValue -&gt; ResolvedBCOPtr
</span><a href="../../ghci/src/GHCi.ResolvedBCO.html#ResolvedBCOPtr"><span class="hs-identifier hs-var">ResolvedBCOPtr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ForeignHValue -&gt; RemoteRef HValue
forall a. ForeignRef a -&gt; RemoteRef a
</span><a href="../../ghci/src/GHCi.RemoteTypes.html#unsafeForeignRefToRemoteRef"><span class="hs-identifier hs-var">unsafeForeignRefToRemoteRef</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621680995370"><span class="hs-identifier hs-var">rhv</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-132"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-133"></span><span>    </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span class="hs-identifier">isExternalName</span><span> </span><span class="hs-identifier">nm</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">nm</span><span class="hs-special">)</span><span>
</span><span id="line-134"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680995361"><span class="annot"><span class="annottext">sym_to_find :: FastString
</span><a href="#local-6989586621680995361"><span class="hs-identifier hs-var hs-var">sym_to_find</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; String -&gt; FastString
</span><a href="GHC.ByteCode.Linker.html#nameToCLabel"><span class="hs-identifier hs-var">nameToCLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995373"><span class="hs-identifier hs-var">nm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;closure&quot;</span></span><span>
</span><span id="line-135"></span><span>       </span><span id="local-6989586621680995360"><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="#local-6989586621680995360"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; FastString -&gt; IO (Maybe (Ptr ()))
</span><a href="GHC.Runtime.Interpreter.html#lookupSymbol"><span class="hs-identifier hs-var">lookupSymbol</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995378"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680995361"><span class="hs-identifier hs-var">sym_to_find</span></a></span><span>
</span><span id="line-136"></span><span>       </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="#local-6989586621680995360"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-137"></span><span>         </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680995359"><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621680995359"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ResolvedBCOPtr -&gt; IO ResolvedBCOPtr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RemotePtr () -&gt; ResolvedBCOPtr
</span><a href="../../ghci/src/GHCi.ResolvedBCO.html#ResolvedBCOStaticPtr"><span class="hs-identifier hs-var">ResolvedBCOStaticPtr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr () -&gt; RemotePtr ()
forall a. Ptr a -&gt; RemotePtr a
</span><a href="../../ghci/src/GHCi.RemoteTypes.html#toRemotePtr"><span class="hs-identifier hs-var">toRemotePtr</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621680995359"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-138"></span><span>         </span><span class="annot"><span class="annottext">Maybe (Ptr ())
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO ResolvedBCOPtr
forall a. String -&gt; String -&gt; IO a
</span><a href="GHC.ByteCode.Linker.html#linkFail"><span class="hs-identifier hs-var">linkFail</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GHC.ByteCode.Linker.lookupCE&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680995361"><span class="hs-identifier hs-var">sym_to_find</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#resolvePtr"><span class="hs-identifier hs-var">resolvePtr</span></a></span><span> </span><span id="local-6989586621680995357"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995357"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="annot"><span class="annottext">ItblEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ClosureEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">NameEnv Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">RemoteRef BreakArray
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.ByteCode.Types.html#BCOPtrPrimOp"><span class="hs-identifier hs-type">BCOPtrPrimOp</span></a></span><span> </span><span id="local-6989586621680995355"><span class="annot"><span class="annottext">PrimOp
</span><a href="#local-6989586621680995355"><span class="hs-identifier hs-var">op</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-140"></span><span>  </span><span class="annot"><span class="annottext">RemotePtr () -&gt; ResolvedBCOPtr
</span><a href="../../ghci/src/GHCi.ResolvedBCO.html#ResolvedBCOStaticPtr"><span class="hs-identifier hs-var">ResolvedBCOStaticPtr</span></a></span><span> </span><span class="annot"><span class="annottext">(RemotePtr () -&gt; ResolvedBCOPtr)
-&gt; IO (RemotePtr ()) -&gt; IO ResolvedBCOPtr
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; PrimOp -&gt; IO (RemotePtr ())
</span><a href="GHC.ByteCode.Linker.html#lookupPrimOp"><span class="hs-identifier hs-var">lookupPrimOp</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995357"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">PrimOp
</span><a href="#local-6989586621680995355"><span class="hs-identifier hs-var">op</span></a></span><span>
</span><span id="line-141"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#resolvePtr"><span class="hs-identifier hs-var">resolvePtr</span></a></span><span> </span><span id="local-6989586621680995353"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995353"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680995352"><span class="annot"><span class="annottext">ItblEnv
</span><a href="#local-6989586621680995352"><span class="hs-identifier hs-var">ie</span></a></span></span><span> </span><span id="local-6989586621680995351"><span class="annot"><span class="annottext">ClosureEnv
</span><a href="#local-6989586621680995351"><span class="hs-identifier hs-var">ce</span></a></span></span><span> </span><span id="local-6989586621680995350"><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680995350"><span class="hs-identifier hs-var">bco_ix</span></a></span></span><span> </span><span id="local-6989586621680995349"><span class="annot"><span class="annottext">RemoteRef BreakArray
</span><a href="#local-6989586621680995349"><span class="hs-identifier hs-var">breakarray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.ByteCode.Types.html#BCOPtrBCO"><span class="hs-identifier hs-type">BCOPtrBCO</span></a></span><span> </span><span id="local-6989586621680995347"><span class="annot"><span class="annottext">UnlinkedBCO
</span><a href="#local-6989586621680995347"><span class="hs-identifier hs-var">bco</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-142"></span><span>  </span><span class="annot"><span class="annottext">ResolvedBCO -&gt; ResolvedBCOPtr
</span><a href="../../ghci/src/GHCi.ResolvedBCO.html#ResolvedBCOPtrBCO"><span class="hs-identifier hs-var">ResolvedBCOPtrBCO</span></a></span><span> </span><span class="annot"><span class="annottext">(ResolvedBCO -&gt; ResolvedBCOPtr)
-&gt; IO ResolvedBCO -&gt; IO ResolvedBCOPtr
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; ItblEnv
-&gt; ClosureEnv
-&gt; NameEnv Int
-&gt; RemoteRef BreakArray
-&gt; UnlinkedBCO
-&gt; IO ResolvedBCO
</span><a href="GHC.ByteCode.Linker.html#linkBCO"><span class="hs-identifier hs-var">linkBCO</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680995353"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ItblEnv
</span><a href="#local-6989586621680995352"><span class="hs-identifier hs-var">ie</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureEnv
</span><a href="#local-6989586621680995351"><span class="hs-identifier hs-var">ce</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv Int
</span><a href="#local-6989586621680995350"><span class="hs-identifier hs-var">bco_ix</span></a></span><span> </span><span class="annot"><span class="annottext">RemoteRef BreakArray
</span><a href="#local-6989586621680995349"><span class="hs-identifier hs-var">breakarray</span></a></span><span> </span><span class="annot"><span class="annottext">UnlinkedBCO
</span><a href="#local-6989586621680995347"><span class="hs-identifier hs-var">bco</span></a></span><span>
</span><span id="line-143"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#resolvePtr"><span class="hs-identifier hs-var">resolvePtr</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ItblEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ClosureEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">NameEnv Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680995345"><span class="annot"><span class="annottext">RemoteRef BreakArray
</span><a href="#local-6989586621680995345"><span class="hs-identifier hs-var">breakarray</span></a></span></span><span> </span><span class="annot"><span class="annottext">BCOPtr
</span><a href="GHC.ByteCode.Types.html#BCOPtrBreakArray"><span class="hs-identifier hs-var">BCOPtrBreakArray</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-144"></span><span>  </span><span class="annot"><span class="annottext">ResolvedBCOPtr -&gt; IO ResolvedBCOPtr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RemoteRef BreakArray -&gt; ResolvedBCOPtr
</span><a href="../../ghci/src/GHCi.ResolvedBCO.html#ResolvedBCOPtrBreakArray"><span class="hs-identifier hs-var">ResolvedBCOPtrBreakArray</span></a></span><span> </span><span class="annot"><span class="annottext">RemoteRef BreakArray
</span><a href="#local-6989586621680995345"><span class="hs-identifier hs-var">breakarray</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span id="local-6989586621680995547"><span class="annot"><a href="GHC.ByteCode.Linker.html#linkFail"><span class="hs-identifier hs-type">linkFail</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621680995547"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-147"></span><span id="linkFail"><span class="annot"><span class="annottext">linkFail :: forall a. String -&gt; String -&gt; IO a
</span><a href="GHC.ByteCode.Linker.html#linkFail"><span class="hs-identifier hs-var hs-var">linkFail</span></a></span></span><span> </span><span id="local-6989586621680995342"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995342"><span class="hs-identifier hs-var">who</span></a></span></span><span> </span><span id="local-6989586621680995341"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995341"><span class="hs-identifier hs-var">what</span></a></span></span><span>
</span><span id="line-148"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GhcException -&gt; IO a
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#ProgramError"><span class="hs-identifier hs-var">ProgramError</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; GhcException) -&gt; String -&gt; GhcException
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-149"></span><span>        </span><span class="annot"><span class="annottext">[String] -&gt; String
</span><a href="../../base/src/Data.OldList.html#unlines"><span class="hs-identifier hs-var">unlines</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995342"><span class="hs-identifier hs-var">who</span></a></span><span>
</span><span id="line-150"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;During interactive linking, GHCi couldn't find the following symbol:&quot;</span></span><span>
</span><span id="line-151"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995341"><span class="hs-identifier hs-var">what</span></a></span><span>
</span><span id="line-152"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;This may be due to you not asking GHCi to load extra object files,&quot;</span></span><span>
</span><span id="line-153"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;archives or DLLs needed by your current session.  Restart GHCi, specifying&quot;</span></span><span>
</span><span id="line-154"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the missing library using the -L/path/to/object/dir and -lmissinglibname&quot;</span></span><span>
</span><span id="line-155"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;flags, or simply by naming the relevant files on the GHCi command line.&quot;</span></span><span>
</span><span id="line-156"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Alternatively, this link failure might indicate a bug in GHCi.&quot;</span></span><span>
</span><span id="line-157"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;If you suspect the latter, please report this as a GHC bug:&quot;</span></span><span>
</span><span id="line-158"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;  https://www.haskell.org/ghc/reportabug&quot;</span></span><span>
</span><span id="line-159"></span><span>                </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#nameToCLabel"><span class="hs-identifier hs-type">nameToCLabel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-163"></span><span id="nameToCLabel"><span class="annot"><span class="annottext">nameToCLabel :: Name -&gt; String -&gt; FastString
</span><a href="GHC.ByteCode.Linker.html#nameToCLabel"><span class="hs-identifier hs-var hs-var">nameToCLabel</span></a></span></span><span> </span><span id="local-6989586621680995337"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995337"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680995336"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995336"><span class="hs-identifier hs-var">suffix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995335"><span class="hs-keyword hs-var">label</span></a></span><span>
</span><span id="line-164"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-165"></span><span>    </span><span id="local-6989586621680995334"><span class="annot"><span class="annottext">encodeZ :: FastString -&gt; String
</span><a href="#local-6989586621680995334"><span class="hs-identifier hs-var hs-var">encodeZ</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastZString -&gt; String
</span><a href="GHC.Data.FastString.html#zString"><span class="hs-identifier hs-var">zString</span></a></span><span> </span><span class="annot"><span class="annottext">(FastZString -&gt; String)
-&gt; (FastString -&gt; FastZString) -&gt; FastString -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastZString
</span><a href="GHC.Data.FastString.html#zEncodeFS"><span class="hs-identifier hs-var">zEncodeFS</span></a></span><span>
</span><span id="line-166"></span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span id="local-6989586621680995328"><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680995328"><span class="hs-identifier hs-var">pkgKey</span></a></span></span><span> </span><span id="local-6989586621680995327"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680995327"><span class="hs-identifier hs-var">modName</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">isExternalName</span><span> </span><span class="hs-identifier">n</span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-identifier">nameModule</span><span> </span><span class="hs-identifier">n</span><span>
</span><span id="line-167"></span><span>    </span><span id="local-6989586621680995324"><span class="annot"><span class="annottext">packagePart :: String
</span><a href="#local-6989586621680995324"><span class="hs-identifier hs-var hs-var">packagePart</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="#local-6989586621680995334"><span class="hs-identifier hs-var">encodeZ</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unit -&gt; FastString
</span><a href="GHC.Unit.Types.html#unitFS"><span class="hs-identifier hs-var">unitFS</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680995328"><span class="hs-identifier hs-var">pkgKey</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span>    </span><span id="local-6989586621680995322"><span class="annot"><span class="annottext">modulePart :: String
</span><a href="#local-6989586621680995322"><span class="hs-identifier hs-var hs-var">modulePart</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="#local-6989586621680995334"><span class="hs-identifier hs-var">encodeZ</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; FastString
</span><a href="GHC.Unit.Module.Name.html#moduleNameFS"><span class="hs-identifier hs-var">moduleNameFS</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680995327"><span class="hs-identifier hs-var">modName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span>    </span><span id="local-6989586621680995320"><span class="annot"><span class="annottext">occPart :: String
</span><a href="#local-6989586621680995320"><span class="hs-identifier hs-var hs-var">occPart</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="#local-6989586621680995334"><span class="hs-identifier hs-var">encodeZ</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; FastString
</span><a href="GHC.Types.Name.Occurrence.html#occNameFS"><span class="hs-identifier hs-var hs-var">occNameFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680995337"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>
</span><span id="line-171"></span><span>    </span><span id="local-6989586621680995335"><span class="annot"><span class="annottext">label :: String
</span><a href="#local-6989586621680995335"><span class="hs-keyword hs-var hs-var">label</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span>
</span><span id="line-172"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680995328"><span class="hs-identifier hs-var">pkgKey</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; Unit -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="GHC.Unit.Types.html#mainUnit"><span class="hs-identifier hs-var">mainUnit</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995324"><span class="hs-identifier hs-var">packagePart</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;_&quot;</span></span><span>
</span><span id="line-173"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995322"><span class="hs-identifier hs-var">modulePart</span></a></span><span>
</span><span id="line-174"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'_'</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995320"><span class="hs-identifier hs-var">occPart</span></a></span><span>
</span><span id="line-175"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'_'</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995336"><span class="hs-identifier hs-var">suffix</span></a></span><span>
</span><span id="line-176"></span><span>        </span><span class="hs-special">]</span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span class="hs-comment">-- See Note [Primop wrappers] in GHC.Builtin.PrimOps</span><span>
</span><span id="line-180"></span><span class="annot"><a href="GHC.ByteCode.Linker.html#primopToCLabel"><span class="hs-identifier hs-type">primopToCLabel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Builtin.PrimOps.html#PrimOp"><span class="hs-identifier hs-type">PrimOp</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-181"></span><span id="primopToCLabel"><span class="annot"><span class="annottext">primopToCLabel :: PrimOp -&gt; String -&gt; String
</span><a href="GHC.ByteCode.Linker.html#primopToCLabel"><span class="hs-identifier hs-var hs-var">primopToCLabel</span></a></span></span><span> </span><span id="local-6989586621680995312"><span class="annot"><span class="annottext">PrimOp
</span><a href="#local-6989586621680995312"><span class="hs-identifier hs-var">primop</span></a></span></span><span> </span><span id="local-6989586621680995311"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995311"><span class="hs-identifier hs-var">suffix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span>
</span><span id="line-182"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ghczmprim_GHCziPrimopWrappers_&quot;</span></span><span>
</span><span id="line-183"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FastZString -&gt; String
</span><a href="GHC.Data.FastString.html#zString"><span class="hs-identifier hs-var">zString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; FastZString
</span><a href="GHC.Data.FastString.html#zEncodeFS"><span class="hs-identifier hs-var">zEncodeFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; FastString
</span><a href="GHC.Types.Name.Occurrence.html#occNameFS"><span class="hs-identifier hs-var hs-var">occNameFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PrimOp -&gt; OccName
</span><a href="GHC.Builtin.PrimOps.html#primOpOcc"><span class="hs-identifier hs-var">primOpOcc</span></a></span><span> </span><span class="annot"><span class="annottext">PrimOp
</span><a href="#local-6989586621680995312"><span class="hs-identifier hs-var">primop</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-184"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'_'</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680995311"><span class="hs-identifier hs-var">suffix</span></a></span><span>
</span><span id="line-185"></span><span>    </span><span class="hs-special">]</span><span>
</span><span id="line-186"></span></pre></body></html>